<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const a = { val: 'a'}
        const b = { val: 'b'}
        const c = { val: 'c'}
        const d = { val: 'd'}

        a.next = b;
        b.next = c;
        c.next = d;

        // 遍历链表
        let p = a;
        while (p) {
            console.log(p.val);
            p = p.next;
        }

        // 插入   把e插入c和d之间
        const e = { val: 'e' };
        c.next = e;
        e.next = d;

        // 删除
        c.next = d;
    </script>
</body>
</html>